﻿using System;
using GdNet.Core.Domain;

namespace GdNet.Core.Dto
{
    public abstract class AbstractEntityWithModificationDto<TEntity, TId> : AbstractEntityDto<TEntity, TId>
        where TEntity : AbstractEntityWithModification<TId>
    {
        public DateTime CreatedAt { get; protected set; }
        public string CreatedBy { get; protected set; }
        public DateTime? LastModifiedAt { get; protected set; }
        public string LastModifiedBy { get; protected set; }

        protected AbstractEntityWithModificationDto(TEntity entity)
            : base(entity)
        {
            this.CreatedAt = entity.CreatedAt;
            this.CreatedBy = entity.CreatedBy;
            this.LastModifiedAt = entity.LastModifiedAt;
            this.LastModifiedBy = entity.LastModifiedBy;
        }
    }
}
